home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / tex / ascutils.zip / ASCUTILS.DOC next >
Text File  |  1988-05-25  |  8KB  |  144 lines

  1.  
  2.                                    DESCRIPTION
  3.         
  4.                                  ASCII  UTILITIES
  5.                                      
  6.         
  7.         This is a collection of ten convenient utilities  for  filtering 
  8.         of  text  files.  While  they  are  in no way unusual,  with the 
  9.         exception of flags.com,  they have in common their  use  of  DOS 
  10.         standard input and standard output,  so command line redirection 
  11.         can (or must,  for disk files) be  used.  Also,  each  program's 
  12.         code is very compact, which facilitates their use with a command 
  13.         librarian  such  as  XEQ115, which is available on better BBS's. 
  14.         
  15.         In addition,  commented assembly code listings for each  of  the 
  16.         ten files is included in this package.  The source code is in no 
  17.         way  remarkable,  but  it  illustrates  a  number  of very basic 
  18.         assembly language programming techniques and the  use  of  basic 
  19.         DOS  function  calls (i.e.,  int 21h calls).  It is my hope that 
  20.         the examples will prove useful for beginning  assembly  language 
  21.         programmers. 
  22.         
  23.         The individual programs tend to be self-explanatory, and usually 
  24.         will output a help message if entered incorrectly or with just a 
  25.         question  mark ('?') as the argument.  The programs that require 
  26.         no command line arguments are: 
  27.                 spctab.com      tabspc.com      rmext.com
  28.                 uniq.com        trim.com
  29.         These utilities perform their functions on the std input stream, 
  30.         and output the results to std output.  This  means  that  if  no 
  31.         redirection  is  entered on the DOS command line,  input will be 
  32.         taken from the keyboard and output will go to  the  console.  To 
  33.         take input from a disk file,  enter [<fname] for the input file.  
  34.         To direct output to disk file,  enter [>fname]  for  the  output 
  35.         file.  Note that output may be directed to a device (such as PRN 
  36.         or  NUL  or  even CON,  which is the default),  so output may be 
  37.         printed directly or even discarded if desired (the NUL device is 
  38.         a 'bit bucket'). 
  39.         
  40.         The programs that do require a command argument (parameter) are:
  41.                 flags.com       cipher.com      prefix.com
  42.                 suffix.com      rmcol.com
  43.         With the exception of flags.com,  the argument(s)  must  precede 
  44.         any  redirection symbols on the command line.  The arguments are 
  45.         fairly obvious,  such as  a  quoted  string  for  prefix.com  or 
  46.         suffix.com,  a  starting  column and column count for rmcol.com, 
  47.         and an un-quoted (and case-sensitive) character  string  (cipher 
  48.         string) for cipher.com.  In the case of flags.com, std input and 
  49.         std  output  are not used,  and the flags (file attribute flags) 
  50.         must follow the filename,  which may be ambiguous (contain  wild 
  51.         cards). 
  52.  
  53.                           
  54.         About the assembly source code -
  55.         
  56.         These  files  were  acquired from various sources without source 
  57.         listings or copyright notices,  so I have taken the  liberty  of 
  58.         disassebling,  debugging  (some  had serious problems),  and re- 
  59.         structuring  the  code  as  logically  as  my  skill  and   time 
  60.         permitted. I have added comments which I hope will be helpful in 
  61.         general,  and  you  are free to modify and use this code as good 
  62.         taste and conscience permit.  I do not solicit any  compensation 
  63.         for these programs, nor do I encourage others to do so. 
  64.                   
  65.         Incidentally,  I  have  attempted  to  make  these  source files 
  66.         compatible with both MASM and A86, so you have your choice. 
  67.         
  68.  
  69.                           
  70.         Program Descriptions -
  71.          
  72.         FLAGS      This  program  may  be  used  to  set  or  reset  the 
  73.                    attribute flags of files.  Usage is: flags [filename] 
  74.                    A H R S where [filename] may contain wildcards (*,?), 
  75.                    and the presence of the letter sets the corresponding 
  76.                    flag (Archive, Hidden, Read-only, and System).  Entry 
  77.                    of  a  file  name  without  flags  resets   all   the 
  78.                    attributes  to normal.  Omission of a filename or use 
  79.                    of an invalid flag designation results  in  an  error 
  80.                    message. 
  81.                    
  82.         CIPHER    This is the same as the DOS cipher command,  and usage 
  83.                   is:  cipher [cipher  string]  [<ifile]  [>ofile].  The 
  84.                   input  file  may be the keyboard,  and the output file 
  85.                   the console.  De-ciphering is done  by  the  identical 
  86.                   procedure  with  the same cipher string.  This is case 
  87.                   sensitive, so take careful note. 
  88.                   
  89.         PREFIX    This program takes a quoted string (either  single  or 
  90.                   double quotes may be used,  as long as they match,  so 
  91.                   the alternate type quote may be used  in  the  string) 
  92.                   and prefixes each line of a text file receive from std 
  93.                   input  with  it.  This  is  only to be used with ASCII 
  94.                   text files,  although line lengths may be  up  to  255 
  95.                   characters with an 80 character prefix. 
  96.                   
  97.         SUFFIX    This  is exactly analogous to PREFIX,  except that the 
  98.                   quoted string is appended to the  ends  of  the  input 
  99.                   lines. 
  100.                   
  101.         SPCTAB    This  converts  single or multiple spaces in the input 
  102.                   lines to an appropriate number and positioning of  tab 
  103.                   characters (the DOS octal tab is used).  Also,  trail- 
  104.                   ing spaces and tabs are removed, so that a significant 
  105.                   reduction in file character  count  may  result.  Uses 
  106.                   std input and output,  ASCII files only.  Lines may be 
  107.                   up to 511 characters long. 
  108.                   
  109.         TABSPC    This is the opposite of SPCTAB,  except that  trailing 
  110.                   white space will not be restored. 
  111.                   
  112.         RMCOL     This  will  remove  a  column  of  0 to 255 contiguous 
  113.                   characters from a text file.  The  column  count  will 
  114.                   reset  at  a  line  boundary.  However,  tabs  will be 
  115.                   treated as single characters,  and  this  may  produce 
  116.                   unexpected results.  Usage is: 
  117.                        rmcol n1{delim}n2 [<ifile] [>[>ofile]]
  118.                   where  n1  is the starting column-1 (0 to 256),  n2 is 
  119.                   the number of columns to remove (0 is accepted, and no 
  120.                   columns will  be  removed),  and  {delim}  is  tab(s), 
  121.                   space(s),  or a single comma if desired.  Careless use 
  122.                   of commas results in errors.  Files are std input  and 
  123.                   std output. 
  124.                   
  125.         RMEXT     This is a limited utility, intended only to remove the 
  126.                   filename extensions from a serial listing,  which must 
  127.                   be trimmed of trailing spaces and spurious characters. 
  128.                   The std input and output streams are use here also. 
  129.                   
  130.         UNIQ      Removes consecutive identical lines from std input and 
  131.                   sends to std output.  If duplicate lines are not  con- 
  132.                   secutive,  a  sort  utility  like the DOS sort command 
  133.                   should be used first to group the lines together. 
  134.                   
  135.         TRIM      This simply removes trailing white  space  from  lines 
  136.                   from std input and writes to std output. 
  137.                   
  138.         I highly recommend XEQ115.COM as a command librarian for these
  139.         types of utilit